package com.xyb.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 课程(CourseDetail)实体类
 *
 * @author makejava
 * @since 2021-11-12 09:53:18
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity
@Table(name = "course_detail")
public class CourseDetail implements Serializable {
    public interface insert {
    }

    ;

    public interface update {
    }

    ;
    private static final long serialVersionUID = 634165430981041266L;
    /**
     * 主键 id
     */
    @Id
    private Long courseDetailId;
    /**
     * 章节id
     */
    @NotNull(message = "章节id不能为空", groups = {CourseDetail.update.class})
    private Long chapterId;
    /**
     * 课程标题
     */
    @NotBlank(message = "课程标题不能为空", groups = {CourseDetail.insert.class, CourseDetail.update.class})
    @Length(max = 40, message = "课程标题不能超过40个字符", groups = {CourseDetail.insert.class, CourseDetail.update.class})
    private String courseDetailName;
    /**
     * 课程详细描述
     */
    private String courseDetailsDesc;
    /**
     * 视频URL
     */
    private String videoUrl;
    /**
     * 状态 0失效 1 在用
     */
    private Integer status;
    /**
     * 排序
     */
    private Integer showOrder;

    @CreatedDate
    private Date createTime;

    @LastModifiedDate
    private Date updateTime;

}